package com.mcflies.study.javaMail.action;

import com.mcflies.study.javaMail.commons.MailSenderInfo;
import com.mcflies.study.javaMail.commons.SimpleMailSender;

public class JavaMailAction {
	public String sendMail() {
		// 这个类主要是设置邮件
		MailSenderInfo mailInfo = new MailSenderInfo();
		mailInfo.setMailServerHost("smtp.sina.com");
		mailInfo.setMailServerPort("25");
		mailInfo.setValidate(true);
		mailInfo.setUserName("mcflies");
		mailInfo.setPassword("lilychenjun12231");// 您的邮箱密码
		mailInfo.setFromAddress("mcflies@sina.com");
		mailInfo.setToAddress("lily_mcfly@sina.com");
		mailInfo.setSubject("美泉");
		mailInfo.setContent("游泳去不");

		// 这个类主要来发送邮件
		SimpleMailSender sms = new SimpleMailSender();
		sms.sendTextMail(mailInfo);// 发送文体格式
		// sms.sendHtmlMail(mailInfo);// 发送html格式
		return "success";
	}
}
